home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / comm / pccp019.zip / EMU.H < prev    next >
C/C++ Source or Header  |  1992-05-07  |  2KB  |  102 lines

  1. /* Released to the Public Domain in 1992 by Peter Edward Cann. */
  2.  
  3.  
  4. /* Substitution Tokens for Function Sequences */
  5. /* n&0xff00 must be nonzero!!! */
  6.  
  7. #define END 0x0100
  8. #define BINCOL 0x0101
  9. #define BINROW 0x0102
  10. #define ASCDECCOL 0x0103
  11. #define ASCDECROW 0x0104
  12. #define ASCDECSEMILIST 0x0105
  13. #define GRABCHAR 0x0106
  14. #define GRAPHCHAR_T 0x0107
  15.  
  16.  
  17. /* Function Codes for Function Sequences */
  18.  
  19. #define CLEAR 0
  20. #define HOME 1
  21. #define CLREOL 2
  22. #define UP 3
  23. #define DOWN 4
  24. #define LEFT 5
  25. #define RIGHT 6
  26. #define GOTO 7
  27. #define NORMAL 8
  28. #define FAINT 9
  29. #define NOFAINT 10
  30. #define BOLD 11
  31. #define NOBOLD 12
  32. #define BLINK 13
  33. #define NOBLINK 14
  34. #define INVERSE 15
  35. #define NOINVERSE 16
  36. #define UPN 17
  37. #define DOWNN 18
  38. #define LEFTN 19
  39. #define RIGHTN 20
  40. #define ANSIATTRIB 21
  41. #define WRAP 22
  42. #define NOWRAP 23
  43. #define GOTOLINE 24
  44. #define GOTOCOL 25
  45. #define WYSEATTR 26
  46. #define GRAPHCHAR 27
  47. #define BEGGRAPH 28
  48. #define ENDGRAPH 29
  49. #define TAB 30  /* Non-destructive */
  50. #define BELL 31
  51. #define DTAB 32  /* Destructive */
  52. #define NOOP 33  /* MUST BE HIGHEST FUNCTION NUMBER! */
  53.  
  54.  
  55. /* Miscellaneous */
  56.  
  57. #define NFUNCS 32  /* Number of Sequences */
  58. #define FUNLEN 16
  59.  
  60. #define KEYLEN 16
  61.  
  62. struct
  63.     {
  64.     struct
  65.         {
  66.         short codes[FUNLEN];
  67.         short func;
  68.         }
  69.         funcs[NFUNCS];
  70.     struct
  71.         {
  72.         short len;
  73.         unsigned char chars[KEYLEN];
  74.         char nullpause_p;
  75.         }
  76.         keys[256];
  77.     char gchars[256];
  78.     int tophi_p;
  79.     int binrowoff;
  80.     int bincoloff;
  81.     int default_wrap_p;
  82.     }
  83.     emu;
  84.  
  85. nullemu()
  86.     {
  87.     int i;
  88.     for(i=0;i<NFUNCS;i++)
  89.         {
  90.         emu.funcs[i].func=NOOP;
  91.         emu.funcs[i].codes[0]=END;
  92.         }
  93.     for(i=0;i<256;i++)
  94.         emu.keys[i].len=0;
  95.     for(i=0;i<256;i++)
  96.         emu.gchars[i]=0;
  97.     emu.keys[0x03].len=1;
  98.     emu.keys[0x03].chars[0]='\0';
  99.     emu.default_wrap_p=1;
  100.     }
  101.  
  102.